 #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time   : 2023-09-17 15:48
# @Author : hard work
# @File    : l4_traffic_util.py
# @Description :
from stc_utils.py_util.l3_traffic_util import Create_l3_traffic


class Create_l4_traffic(Create_l3_traffic):

    def __init__(self, stcInstallDir, stc_Chassis_addr, slot, port_TX, port_RX, port_RX_OB, port_RX_20, port_RX_16):
        super().__init__(stcInstallDir, stc_Chassis_addr, slot, port_TX, port_RX, port_RX_OB, port_RX_20, port_RX_16)
        # self.dport = None
        # self.sport = None

    def create_tcp_flow(self,sport,dport):
        htcp = self.stc.create("tcp:Tcp", under=self.hStreamBlock, name="sb1_tcp",
                               sourcePort=sport, destPort=dport)

    def create_udp_flow(self,sport,dport):
        hudp = self.stc.create("udp:Udp", under=self.hStreamBlock, name="sb1_udp",
                          sourcePort=sport , destPort=dport)